package com.baidu.cmsCommes.pojo;

import lombok.Data;

/**
 * @Author: BSS
 * @create: 2020/6/17/20:48
 */
@Data
public class SystemContext {
    /**
     * 分页大小
     */
    private static ThreadLocal<Integer> pageSize = new ThreadLocal<Integer>();
    /**
     * 分页起始页
     */
    private static ThreadLocal<Integer> pageOffset = new ThreadLocal<Integer>();
    /**
     * 排序的字段
     */
    private static ThreadLocal<String> sort = new ThreadLocal<String>();
    /**
     * 排序方式
     */
    private static ThreadLocal<String> order = new ThreadLocal<String>();

    public static Integer getPageSize() {
        return pageSize.get();
    }

    public static void setPageSize(Integer pageSize) {
        SystemContext.pageSize.set(pageSize);
    }

    public static Integer getPageOffset() {
        return pageOffset.get();
    }

    public static void setPageOffset(Integer pageOffset) {
        SystemContext.pageOffset.set(pageOffset);
    }

    public static String getSort() {
        return sort.get();
    }

    public static void setSort(String sort) {
        SystemContext.sort.set(sort);
    }

    public static String getOrder() {
        return order.get();
    }

    public static void setOrder(String order) {
        SystemContext.order.set(order);
    }
}
